//
//  YZAutoRowModel.m
//  VET
//
//  Created by Lam BG on 2018/7/13.
//  Copyright © 2018年 YZ. All rights reserved.
//

#import "YZAutoRowModel.h"

// 第三方
#import "MJExtension.h"

#import "NSString+Category.h"

@implementation YZAutoRowModel

+ (NSDictionary*)mj_replacedKeyFromPropertyName {
    
    // item model -> row model 映射
    return @{
             @"displayValue" : @"dictValue",
             @"paramValue" : @"id"
             };
}

- (NSAttributedString *)attributedTitle {
    
    // 可编辑时 判断 isMust YES：添加 * / NO：直接显示
    NSAttributedString *attr = nil;
    if (self.isUnEdit == NO && self.isMust == YES) {
        
        attr = [[NSString stringWithFormat:@"%@ *", self.title] searchKeyWord:@"*" matchColor:kColorWithHex(0xFF5656)];

    } else {
        
        attr = [[NSMutableAttributedString alloc] initWithString:self.title];
    }
    
    return attr;
}

@end








